package com.portal4kids.view;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.portal4kids.controller.PlacesManager;
import com.portal4kids.model.Places;
import com.portal4kids.model.PlacesAttribute;

public class PlacesAction extends ActionSupport{
	private PlacesManager linkController;
	private List<Places> placesList;
	private Places place;
	private PlacesAttribute attributes;
	private String typePlace;
	
	public PlacesAction(){
		linkController = new PlacesManager();
	}
	public String execute(){
		placesList = linkController.placesList();
		return SUCCESS;		
	}
	
	public String savePlace(){
		place = linkController.savePlace(getPlace(), getAttributes());
		return SUCCESS;		
	}
	
	public String searchPlace(){
		
			placesList = linkController.searchPlaces(getAttributes(), getTypePlace());
			return SUCCESS;		
		
	}
	
	public List<Places> getPlacesList() {
		return placesList;
	}
	public void setPlacesList(List<Places> placesList) {
		this.placesList = placesList;
	}
	public Places getPlace() {
		return place;
	}
	public void setPlace(Places place) {
		this.place = place;
	}
	public PlacesAttribute getAttributes() {
		return attributes;
	}
	public void setAttributes(PlacesAttribute attributes) {
		this.attributes = attributes;
	}
	public String getTypePlace() {
		return typePlace;
	}
	public void setTypePlace(String typePlace) {
		this.typePlace = typePlace;
	}
	
	
	
}
